coding exercise with solution